The planet Xavier follows an elliptical orbit with its sun at one focus.  At its nearest point (perigee), it is 2 astronomical units (AU) from the sun, while at its furthest point (apogee) it is 12 AU away.  When Xavier is midway along its orbit, as shown, how far is it from the sun, in AU?

[asy]
unitsize(1 cm);

path ell = xscale(2)*arc((0,0),1,-85,265);

filldraw(Circle((0,-1),0.1));
filldraw(Circle((-1.4,0),0.2),yellow);
draw(ell,Arrow(6));
[/asy]
Answer: Let $A$ be the perigee, let $B$ be the apogee, let $F$ be the focus where the sun is, let $O$ be the center of the ellipse, and let $M$ be the current position of Xavier.

[asy]
unitsize(1 cm);

pair A, B, F, M, O;

path ell = xscale(2)*Circle((0,0),1);

A = (-2,0);
B = (2,0);
F = (-sqrt(3),0);
O = (0,0);
M = (0,-1);

draw(ell);
draw(A--M);
draw(O--M);
draw(F--M);
draw(A--B);

dot("$A$", A, W);
dot("$B$", B, E);
dot("$F$", F, N);
dot("$M$", M, S);
dot("$O$", O, N);
[/asy]

Then $AB$ is a major axis of the ellipse, and $AB = 2 + 12 = 14.$  Since $M$ is the midway point, $MF = AO = \frac{14}{2} = \boxed{7}.$